import { CommunityStatus } from '@/enum';
import { IsEnum, IsOptional } from 'class-validator';

export default class CommunityListDto {
  pageNum: number;
  pageSize: number;
  userId: number;
  username: string;

  @IsOptional()
  @IsEnum(CommunityStatus, {
    message: '类型必须是  0:未审核 1:已通过 2:已拒绝',
  })
  status: number;

  @IsOptional()
  @IsEnum(['asc', 'desc'], {
    message: '排序必须是 asc 或 desc',
  })
  sort: string;
}
